package com.bicon.botu.core.base.common.persistence;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.Length;
import org.springframework.data.annotation.Id;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * Created by lenovo on 2016/9/1.
 */
@ApiModel(value = "基础类")
public abstract class MongoEntity<T> implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 实体编号（唯一标识）
     */
    @ApiModelProperty(value = "类主键")
    @Id
    protected String id;
    @ApiModelProperty(value = "备注")
    protected String remarks;	// 备注
    @ApiModelProperty(value = "创建者")
    protected String createBy;	// 创建者
    @ApiModelProperty(value = "创建日期")
    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
    protected Date createDate;	// 创建日期
    @ApiModelProperty(value = "更新者")
    protected String updateBy;	// 更新者
    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
    @ApiModelProperty(value = "更新日期")
    protected Date updateDate;	// 更新日期
    @ApiModelProperty(value = "删除标记（0：正常；1：删除；2：审核")
    protected String delFlag; 	// 删除标记（0：正常；1：删除；2：审核）


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Length(min=0, max=255)
    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    @JsonIgnore
    public String getCreateBy() {
        return createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    @JsonIgnore
    public String getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    @JsonIgnore
    @Length(min=1, max=1)
    public String getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(String delFlag) {
        this.delFlag = delFlag;
    }

}
